
//显示搜索栏
var nav = document.getElementById("header");
window.onscroll = function() {
		if(navigator.userAgent.indexOf("Firefox") >= 0) {
			var top = document.documentElement.scrollTop;
		} else {
			var top = document.body.scrollTop;
		}
		if(top >= 0) {
			nav.style.top = top + "px";
			if(top >= 200) {
				nav.style.display = "block";
			} else {
				nav.style.display = "none";
			}
		}
	}



//轮播图
var img = document.querySelector('.banner_img img');
var num = 1;
setInterval(function(){
	img.src = 'img/head_0'+num+'.jpg';
	num++;
	if(num ==5){
		num = 1;
	}

},2000);

//切换显示内容
window.onload = function() {
		var content = document.querySelectorAll("#content span a");
		for(var i=0;i<content.length;i++){
			content[i].index=i;
			content[i].onmouseover=function(ev){
				this.className="active";			
				var text=ev.target.offsetParent.children[i]
				text.style.display="block";
				
		}
			content[i].onmouseout=function(ev){
				var text=ev.target.offsetParent.children[i]
				text.style.display="none";
				this.className="";
				
			}
		}
}		